﻿using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using Crow.Library.Host.Configuration;

namespace Crow.Library.Host.AspNet
{
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
    public class AspNetRoutedHost : IHttpHost
    {
        public static ITypeListHost HostList { get; private set; }

        public void InitializeHost(HttpConfiguration configuration, HttpMessageHandler messageHandler,
                                   ITypeListHost typeList)
        {
            HostList = typeList;
        }

        public Task OpenAsync()
        {
            return Task.Factory.StartNew(() => { });
        }

        public Task CloseAsync()
        {
            return Task.Factory.StartNew(() => { });
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
        public void Dispose()
        {
            //TODO: implement disposable pattern
        }
    }
}